<template>
	<view>
		<van-popup :show.sync="value" round @close="close">
			<view class="alert">
				<view class="title">{{title}}</view>
				<view class="btn" @click="confirm">{{btnTxt}}</view>
			</view>
		</van-popup>
	</view>
</template>

<script>
	export default {
		name: "con-toast",
		props: {
			title: {
				type: String,
				required: true
			},
			btnTxt: {
				type: String,
				required: true
			},
			value: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {

			};
		},
		methods: {
			close() {
				this.$emit("input", false)
			},
			confirm(){
				this.$emit("confirm",false)
			}
		},
	}
</script>

<style lang="scss" scoped>
	.alert {
		width: calc(100vw - 100rpx);
		padding: 59rpx 0 40rpx;
		background-color: rgb(255, 255, 255);

		.title {
			color: rgb(51, 51, 51);
			font-size: 30rpx;
			font-weight: 700;
			margin-bottom: 61rpx;
			text-align: center;
		}

		.btn {
			width: fit-content;
			margin: auto;
			padding: 12rpx 55rpx 18rpx;
			color: rgb(255, 255, 255);
			font-size: 28rpx;
			font-weight: 700;
			border-radius: 40rpx;
			background-image: linear-gradient(0deg, rgb(99, 93, 247) 0%, rgb(165, 173, 246) 100%);
		}
	}
</style>
